package juf;

import java.lang.annotation.Annotation;


/**An interface for a data source
 * 
 * Using a seperate interface for the data source 
 * allows bindings from multiple data sources (beans, pojo, etc)
 * 
 * 
 * @author Dale Halliwell
 *
 */
public interface Property {

	/**
	 * String describin the field (e.g. "First Name:")
	 * @return string describing the field
	 */
	public String getName();
	
	/**The Class of the parameter/field of the bound member
	 * @return true if readonly
	 */
	@SuppressWarnings("unchecked")
	public Class getType();
	
	/**Whether or not the Property can be written to
	 * (actions setValue() calls)
	 * @return true if readonly
	 */
	public boolean isReadOnly();
	
	/**Get the value of the bound member
	 * @return current value of the member
	 */
	public Object getValue();
	
	/**Change the value of the bound member
	 * @param value new value of the member
	 */
	public void setValue(Object value);
	
	/**Gets the annotations on the bound member (for a method-pair, only the getter has annotations)
	 * @return annotations on this member
	 */
	public Annotation[] getAnnotations();
	
}
